﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Messaging;
namespace AgileLogistics.View.Cailiao
{
    /// <summary>
    /// Page_Cailiao.xaml 的交互逻辑
    /// </summary>
    public partial class Page_Cailiao : Page
    {
        private Model.DBContext dbContext =new  Model.DBContext();

        public Page_Cailiao()
        {
            InitializeComponent();

            Messenger.Default.Register<Page>(this, "NavigatePage", NavigatePage);
            var CurrRole = dbContext.DB.Queryable<Model.Roles>().Where(r => r.Id == Comm.Temp.LoginUser.RoleId).First();

            if (!CurrRole.FuncCailiao)
            {
                menu_Daiban.Visibility = Visibility.Collapsed;
                mu_Handle.Visibility = Visibility.Collapsed;
                
            }

        }

        private void SideMenu_SelectionChanged(object sender, HandyControl.Data.FunctionEventArgs<object> e)
        {
            var item = Menu.Items[0] as HandyControl.Controls.SideMenuItem;
             
        }


        public void NavigatePage(Page page)
        {
            Frm.Navigate(page);
        }
    }
}
